namespace HabilisDesign.Scribbler
{
    using System.Collections.Generic;

    public class ClippingCollection
    {
        private List<Clipping> _Collection;
        private int _Capacity = 20;

        public Clipping this[int index]
        {
            get
            {
                return _Collection[index];
            }
        }

        public int Capacity
        {
            get
            {
                return _Collection.Capacity;
            }
            set
            {
                _Collection.RemoveRange( 0, _Collection.Count - value );
                _Collection.Capacity = value;
            }
        }

        public ClippingCollection()
        {
            _Collection = new List<Clipping>( 20 );
        }

        public void Add( Clipping clipping )
        {
            if ( _Collection.Count == Capacity )
            {
                _Collection.RemoveAt( 0 );
            }
            _Collection.Add( clipping );
        }
    }
}
